﻿<MDCard Class="h-100">
    <img src="@Model.Image" alt="@Model.Name" class="w-100 pointer" onclick="@OnClickImage">

    <div style="display: flex; flex-direction: column; word-break: break-all; " class="ps-3 pe-3 pt-2 pb-2">
        @if (string.IsNullOrWhiteSpace(Model.Link))
        {
            <div class="d-flex">
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Lottery" />
                <div style="display: inline; word-break: break-word;">
                    <span class="fw-bold">
                        @($"{Model.Name}")
                    </span>
                    <span>
                        @($"x{Model.Count}")
                    </span>
                </div>

            </div>
        }
        else
        {
            <div class="d-flex">
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Lottery" />
                <div style="display: inline; word-break: break-word;">
                    <a href="@Model.Link" target="@(Model.Link.ToLower().Contains("http")?"_blank":"")" class="fw-bold">
                        @($"{Model.Name}")
                    </a>
                    <span>
                        @($"x{Model.Count}")
                    </span>
                </div>

            </div>
        }

        @if (string.IsNullOrWhiteSpace(Model.Sponsor) == false)
        {
            <div class="d-flex">
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Sponsor" />
                <div style="display: inline; word-break: break-word;">
                    <span>
                        赞助商：
                    </span>
                    <span class="fw-bold">
                        @Model.Sponsor
                    </span>
                </div>
            </div>
        }

    </div>
</MDCard>
@code {
    [Parameter]
    public LotteryAwardViewModel Model { get; set; }
    [Parameter]
    public EventCallback OnClickImage { get; set; }
}
